import request from '@/utils/request'

// 查询采购列表
export function listBuy(query) {
  return request({
    url: '/ypjxc/order/list',
    method: 'get',
    params: query
  })
}


export function getSupplier() {
  return request({
    url: '/ypjxc/order/getSupplier',
    method: 'get',
  })
}

// 查询采购详细
export function getOrderId(query) {
  return request({
    url: '/ypjxc/order/getOrderId',
    method: 'get',
    params: query
  })
}

// 查询药品类型详细
export function listBuyType(query) {
  return request({
    url: '/ypjxc/order/getBuyType',
    method: 'get',
    params: query
  })
}

//查询药品
export function getBuy(Id) {
  return request({
    url: '/ypjxc/buy/' + Id,
    method: 'get'
  })
}

// 新增采购
export function addBuy(data) {
  return request({
    url: '/ypjxc/buy',
    method: 'post',
    data: data
  })
}

// 修改采购
export function updateBuy(data) {
  return request({
    url: '/ypjxc/buy',
    method: 'put',
    data: data
  })
}

// 删除采购
export function delBuy(buyIds) {
  return request({
    url: '/ypjxc/buy/' + buyIds,
    method: 'delete'
  })
}

// 导出采购
export function exportBuy(query) {
  return request({
    url: '/ypjxc/buy/export',
    method: 'get',
    params: query
  })
}
